using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Sharpmark.PerfectLife.ColorfulPhotos.TextualPhoto.SubFunctionForm
{
	public partial class FrmThumbnailView : Form
	{
		private Image _image;
		public FrmThumbnailView (string filename)
		{
			_image = Bitmap.FromFile(filename);

            InitializeComponent();

			BindImage();
		}

		public FrmThumbnailView (Image image)
		{
			InitializeComponent();

			_image = image;
		}

		private void FrmThumbnailView_Paint (object sender, PaintEventArgs e)
		{
			// BindImage();
		}

		private void BindImage ()
		{
			this.pcbThumbnailViewer.Image = _image.GetThumbnailImage(
				this.pcbThumbnailViewer.Width,
				this.pcbThumbnailViewer.Height,
				null, IntPtr.Zero);
		}

		private void FrmThumbnailView_Resize (object sender, EventArgs e)
		{
			BindImage();
		}

		private void FrmThumbnailView_Load (object sender, EventArgs e)
		{
			BindImage();
		}
	}
}